/**
 * @遍历一个链表
 *
 * @author	 wangshikun <wangshikun2010@gmail.com>
 * @copyright	(c) 2012 wangshikun <wangshikun2010@gmail.com>
 * @license	http://www.opensource.org/licenses/mit-license.php The MIT License
 * @package	default
 * @subpackage	default
 */

#include <stdio.h>

int main(void) {
	struct entry {
		int value;
		struct entry *next;
	};

	struct entry n1, n2, n3;
	struct *list_pointer = &n1;

	n1.value = 100;
	n1.next = &n2;

	n2.value = 200;
	n2.next = &n3;

	n3.value = 300;
	n3.next = (struct entry *) 0;

	while (list_pointer != (struct entry *) 0) {
		printf("%d\n", list_pointer->value);
		list_pointer = list_pointer->next;
	}

	return 0;
}
